package com.hsylient.javase.chapter10;

import org.junit.Test;

import java.util.Random;

public class MyRandom {

    private static Random random = new Random();

    @Test
    public void testMethod() {
        System.out.println(Math.random());
        random.ints(10)
                .filter(x -> x > 0)
                .forEach(System.out::println);

    }

    private static void cycle() {
        for (;;) {
            System.out.println(random.nextInt());
            System.out.println(random.nextInt(3));
        }
    }

    @Test
    public void testNextInt() {
        int nextInt = random.nextInt(10);
        System.out.println(nextInt);
    }

}
